﻿<Window x:Class="Arcadia.Bookasa.Main.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Bookasa" Height="768" Width="1024">
    <Window.Resources>
        <LinearGradientBrush x:Key="shinyBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Offset="0" Color="Gray"/>
            <GradientStop Offset="0.3" Color="#FF222222"/>
            <GradientStop Offset="0.3" Color="Black"/>
            <GradientStop Offset="0.9" Color="Black"/>
            <GradientStop Offset="0.9" Color="#FF222222"/>
            <GradientStop Offset="1" Color="Gray"/>
        </LinearGradientBrush>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition/>
            <RowDefinition Height="55"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Rectangle Grid.ColumnSpan="3" Fill="{StaticResource shinyBrush}"/>
        <Menu Background="Transparent" Name="menu1" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.ColumnSpan="3" Foreground="White">
            <MenuItem Header="_File" Foreground="White">
                <MenuItem x:Name="favoritesMenu" Header="Add Current Folder to Fa_vorites" Click="favoritesMenu_Click" Foreground="Black" />
                <MenuItem x:Name="deleteMenu" IsEnabled="False" Header="De_lete" Click="deleteMenu_Click" Foreground="Black" />
                <MenuItem x:Name="renameMenu" IsEnabled="False" Header="Rena_me" Click="renameMenu_Click" Foreground="Black" />
                <Separator/>
                <MenuItem Header="_Refresh" Click="refreshMenu_Click" Foreground="Black" />
                <Separator/>
                <MenuItem Header="E_xit" Click="exitMenu_Click" Foreground="Black" />
            </MenuItem>
            <MenuItem x:Name="fixMenu" Foreground="White" IsEnabled="False" Click="fixMenu_Click" Header="Fi_x"/>
            <MenuItem x:Name="printMenu" Foreground="White" Click="printMenu_Click" IsEnabled="False" Header="_Print"/>
            <MenuItem x:Name="editMenu" Foreground="White" IsEnabled="False" Header="_Edit" Click="editMenu_Click" />
            <Button x:Name="backButton" Click="backButton_Click" Visibility="Hidden">Back To Gallery</Button>
        </Menu>
        <!-- Layer #1 -->
        <TreeView x:Name="treeView" Grid.Row="1" Background="AliceBlue" SelectedItemChanged="folders_SelectedItemChanged">
            <TreeViewItem x:Name="favoritesItem" IsExpanded="True" Header="Favorites"/>
            <TreeViewItem x:Name="foldersItem" Header="Local File System"/>
        </TreeView>
        <GridSplitter Grid.Row="1" Grid.Column="1" ResizeBehavior="PreviousAndNext"/>
        <ListBox x:Name="pictureBox" Background="AliceBlue" SelectionChanged="pictureBox_SelectionChanged" Grid.Row="1" Grid.Column="2" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>

        <!-- Layer #2 -->
        <DockPanel x:Name="imageView" Visibility="Hidden" SnapsToDevicePixels="True" Grid.Row="1" Grid.ColumnSpan="3">
            <StackPanel x:Name="fixBar" DockPanel.Dock="Right">
                <StackPanel.Background>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Offset="0" Color="LightBlue"/>
                        <GradientStop Offset="1" Color="AliceBlue"/>
                    </LinearGradientBrush>
                </StackPanel.Background>
                <Button Click="fix_RotateClockwise_Click" Margin="20">Rotate Clockwise</Button>
                <Button Click="fix_RotateCounterclockwise_Click" Margin="20">Rotate Counterclockwise</Button>
                <Button Click="fix_Save_Click" Margin="20">Save</Button>
            </StackPanel>
            <Grid Background="AliceBlue">
                <Image VerticalAlignment="Center" x:Name="image">
                    <Image.LayoutTransform>
                        <RotateTransform/>
                    </Image.LayoutTransform>
                </Image>
            </Grid>
        </DockPanel>

        <Grid Grid.Row="2" Grid.ColumnSpan="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Width="69" VerticalAlignment="Center" x:Name="zoomButton" Click="zoomButton_Click" ClickMode="Press" ToolTip="Change the Display Size">
                    <Image Height="22" Source="images\zoom.gif"/>
                </Button>
                <Popup x:Name="zoomPopup" MouseLeave="zoomPopup_MouseLeave" PlacementTarget="{Binding ElementName=zoomButton}" Placement="Center" StaysOpen="False">
                    <Grid Background="White">
                        <Border BorderBrush="Black" BorderThickness="1">
                            <Slider Margin="20" Orientation="Vertical" x:Name="zoomSlider" Value="3" Minimum="1" Maximum="10" Height="100" ValueChanged="zoomSlider_ValueChanged"/>
                        </Border>
                    </Grid>
                </Popup>
                <Button x:Name="defaultSizeButton" Click="defaultSizeButton_Click" Width="69" VerticalAlignment="Center" ToolTip="Set Default Thumbnail Size">
                    <Image Height="22" Source="images\defaultThumbnailSize.gif"/>
                </Button>
            </StackPanel>
            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
                <Button x:Name="previousButton" Click="previousButton_Click" VerticalAlignment="Center" IsEnabled="False" Opacity=".5" ToolTip="Previous (Left Arrow)">
                    <Image Height="22" Source="images\previous.gif"/>
                </Button>
                <Button x:Name="slideshowButton" Click="slideshowButton_Click" Height="42" Width="52" VerticalAlignment="Center" ToolTip="Play Slide Show">
                    <Image Height="22" Source="images\slideshow.gif"/>
                </Button>
                <Button x:Name="nextButton" Click="nextButton_Click" VerticalAlignment="Center" IsEnabled="False" Opacity=".5" ToolTip="Next (Right Arrow)">
                    <Image Height="22" Source="images\next.gif"/>
                </Button>
            </StackPanel>
            <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Left">
                <Button x:Name="counterclockwiseButton" Click="counterclockwiseButton_Click" Width="46" IsEnabled="False" Opacity=".5" VerticalAlignment="Center" ToolTip="Rotate Counterclockwise">
                    <Image Height="22" Source="images\counterclockwise.gif"/>
                </Button>
                <Button x:Name="clockwiseButton" Click="clockwiseButton_Click" Width="46" IsEnabled="False" Opacity=".5" VerticalAlignment="Center" ToolTip="Rotate Clockwise">
                    <Image Height="22" Source="images\clockwise.gif"/>
                </Button>
                <Button x:Name="deleteButton" Click="deleteButton_Click" Width="46" IsEnabled="False" Opacity=".5" VerticalAlignment="Center" ToolTip="Delete (Del)">
                    <Image Height="22" Source="images\delete.gif"/>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>

</Window>
